//
//  BaseViewController.m
//  LOLProject
//
//  Created by SXW on 16/3/23.
//  Copyright © 2016年 盛宣伟. All rights reserved.
//

#import "BaseViewController.h"

// 在debug 区域 输入po + 大打印的内容，做断点调试用

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //基类 设置各个滑动界面的整体的颜色
    self.view.backgroundColor = [UIColor colorFromHexRGB:APPBackgroundColor];
    
}

-(void)initData:(void (^)(id))data{

    [RZHttpTool postWithURL:self.urlStr params:self.parameterDic success:^(id success) {
        
        NSDictionary *erroDic = success;
        if ([[erroDic objectForKey:@"error_code"] integerValue] == 100) {
            [self.view addSubview:self.emptyView];
            self.isShowEmptyView = YES;
        }
        
        data(success);
    } failure:^(NSError *error) {
        
        //EmptyView
    }];
}



-(EmptyView *)emptyView{

    if (_emptyView == nil) {
        if (CGRectEqualToRect(self.emptyViewFrame, CGRectZero)) {
            self.emptyViewFrame = self.view.frame;
        }
        _emptyView = [[EmptyView alloc] initWithFrame:self.emptyViewFrame];
        _emptyView.backgroundColor = [UIColor blackColor];
    }
    return _emptyView;
}

-(NSMutableArray *)jsonArray{

    if (!_jsonArray) {
        _jsonArray = [NSMutableArray new];
    }
    return _jsonArray;
}

- (NSMutableDictionary *)parameterDic
{
    if (!_parameterDic) {
        _parameterDic = [NSMutableDictionary dictionary];
    }
    return _parameterDic;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
